package traveldream.web.beans;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import traveldream.ejb.usermanagement.UserMgr;
import traveldream.ejb.usermanagement.dto.UserDTO;

@ManagedBean
@RequestScoped
public class UserBean {
	
	@EJB
	private UserMgr userMgr;
	
	UserDTO user = new UserDTO();
	
	public UserBean(){
		
	}
	
	public long getCid(){
		return userMgr.getUserDTO().getCid();
	}
	
	public String getPass(){
		return userMgr.getUserDTO().getPassword();
	}
	public String getName() {
		return userMgr.getUserDTO().getFirstName();
	}
	
	public String getLastName(){
		return userMgr.getUserDTO().getLastName();
	}
	
	public String getEmail(){
		return userMgr.getUserDTO().getEmail();
	}
	

	public UserDTO getUser() {
		return user;
	}

	public void setUser(UserDTO user) {
		this.user = user;
	}
	
	public String modify(){
		userMgr.update(user);
		return "index.html";
	}
}
